Source for file GroupRights.php
Documentation is available at GroupRights.php
<?php require_once 'index.php'; ?>
$groups = $admin->perm ->getGroups ();
echo 'Run the <b>Group</b> test first<br />';
$rights = $admin->perm ->getRights ();
echo 'Run the <b>Right</b> test first<br />';
for ($i = 0; $i < 20; $i++ ) {
'group_id' => $groups[$group]['group_id'],
'right_id' => $rights[$right]['right_id']
$granted = $admin->perm ->grantGroupRight ($data);
if ($granted === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'Group <b>' . $group . '</b> was granted the right <b>'. $right. '</b><br />';
'group_id' => $groups[$group]['group_id']
$allGroupRights = $admin->perm ->getRights ($params);
if ($allGroupRights === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo '<hr />Here is/are <b>' . count($allGroupRights) . '</b> group right(s) for the group <b>' . $groups[$group]['group_id'] . '</b>:<br />';
Var_Dump ::display ($allGroupRights);
'right_id' => $rights[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$removed = $admin->perm ->revokeGroupRight ($filters);
if ($removed === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'Removed the right <b>'. $right. '</b> on group <b>'. $group. '</b><br />';
'group_id' => $groups[$group]['group_id']
$rights_group = $admin->perm ->getRights ($params);
if ($rights_group === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
$data = array ('right_level' => 2 );
'right_id' => $rights_group[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$updated = $admin->perm ->updateGroupRight ($data, $filters);
if ($updated === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
echo 'Updated the right level of <b>' . $groups[$group]['group_id'] . '</b><br />';
'right_id' => $rights_group[$right]['right_id'],
'group_id' => $groups[$group]['group_id']
$result = $admin->perm ->getRights ($params);
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
Var_Dump ::display ($result);
$allGroups = $admin->perm ->getRights ($params);
echo 'Here are all the group rights after the changes:<br />';
if ($allGroups === false ) {
echo '<strong>Error on line: '.__LINE__. ' last query: '. $admin->perm ->_storage ->dbc ->last_query. '</strong><br />';
Var_Dump ::display ($allGroups);
Documentation generated on Mon, 11 Mar 2019 14:00:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|